package com.yuanfeng.business.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 门店账号
 * @TableName shop_gate
 */
@TableName(value ="shop_gate")
@Data
public class ShopGateEntity implements Serializable {
    /**
     * 门店ID
     */
    @TableId(type = IdType.AUTO)
    private Integer shopGateId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 所属店铺
     */
    private Integer shopId;

    /**
     * 登录名(手机号：1.已注册；2.未开通店铺和门店)
     */
    private String loginName;

    /**
     * 登录密码
     */
    private String gatePassword;

    /**
     * 店铺状态：0.关闭；1.开启
     */
    private Integer state;

    /**
     * 门店名称
     */
    private String shopGateName;

    /**
     * 门店描述
     */
    private String shopGateDesc;

    /**
     * 省
     */
    private String province;

    /**
     * 市
     */
    private String city;

    /**
     * 区/县
     */
    private String county;

    /**
     * 详细地址
     */
    private String detailAddress;

    /**
     * 经度
     */
    private String longitude;

    /**
     * 纬度
     */
    private String latitude;

    /**
     * 联系电话
     */
    private String gatePhone;

    /**
     * 营业时间
     */
    private String businessTime;

    /**
     * 交通路线
     */
    private String trafficRoute;

    /**
     * 实况照片URL
     */
    private String gatePic;

    /**
     * 权限
     */
    private String limits;

    /**
     * 1 商家店铺 2 供应商店铺 3 品牌店铺
     */
    private Integer shopType;

    /**
     * 省
     */
    @TableField(exist = false)
    private String provinceId;

    /**
     * 市
     */
    @TableField(exist = false)
    private String cityId;

    /**
     * 区/县
     */
    @TableField(exist = false)
    private String countyId;

    @TableField(exist = false)
    private String shopGateAddress;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopGateEntity other = (ShopGateEntity) that;
        return (this.getShopGateId() == null ? other.getShopGateId() == null : this.getShopGateId().equals(other.getShopGateId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
            && (this.getLoginName() == null ? other.getLoginName() == null : this.getLoginName().equals(other.getLoginName()))
            && (this.getGatePassword() == null ? other.getGatePassword() == null : this.getGatePassword().equals(other.getGatePassword()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getShopGateName() == null ? other.getShopGateName() == null : this.getShopGateName().equals(other.getShopGateName()))
            && (this.getShopGateDesc() == null ? other.getShopGateDesc() == null : this.getShopGateDesc().equals(other.getShopGateDesc()))
            && (this.getProvince() == null ? other.getProvince() == null : this.getProvince().equals(other.getProvince()))
            && (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
            && (this.getCounty() == null ? other.getCounty() == null : this.getCounty().equals(other.getCounty()))
            && (this.getDetailAddress() == null ? other.getDetailAddress() == null : this.getDetailAddress().equals(other.getDetailAddress()))
            && (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude().equals(other.getLongitude()))
            && (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(other.getLatitude()))
            && (this.getGatePhone() == null ? other.getGatePhone() == null : this.getGatePhone().equals(other.getGatePhone()))
            && (this.getBusinessTime() == null ? other.getBusinessTime() == null : this.getBusinessTime().equals(other.getBusinessTime()))
            && (this.getTrafficRoute() == null ? other.getTrafficRoute() == null : this.getTrafficRoute().equals(other.getTrafficRoute()))
            && (this.getGatePic() == null ? other.getGatePic() == null : this.getGatePic().equals(other.getGatePic()))
            && (this.getLimits() == null ? other.getLimits() == null : this.getLimits().equals(other.getLimits()))
            && (this.getShopType() == null ? other.getShopType() == null : this.getShopType().equals(other.getShopType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getShopGateId() == null) ? 0 : getShopGateId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
        result = prime * result + ((getLoginName() == null) ? 0 : getLoginName().hashCode());
        result = prime * result + ((getGatePassword() == null) ? 0 : getGatePassword().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getShopGateName() == null) ? 0 : getShopGateName().hashCode());
        result = prime * result + ((getShopGateDesc() == null) ? 0 : getShopGateDesc().hashCode());
        result = prime * result + ((getProvince() == null) ? 0 : getProvince().hashCode());
        result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
        result = prime * result + ((getCounty() == null) ? 0 : getCounty().hashCode());
        result = prime * result + ((getDetailAddress() == null) ? 0 : getDetailAddress().hashCode());
        result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
        result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
        result = prime * result + ((getGatePhone() == null) ? 0 : getGatePhone().hashCode());
        result = prime * result + ((getBusinessTime() == null) ? 0 : getBusinessTime().hashCode());
        result = prime * result + ((getTrafficRoute() == null) ? 0 : getTrafficRoute().hashCode());
        result = prime * result + ((getGatePic() == null) ? 0 : getGatePic().hashCode());
        result = prime * result + ((getLimits() == null) ? 0 : getLimits().hashCode());
        result = prime * result + ((getShopType() == null) ? 0 : getShopType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", shopGateId=").append(shopGateId);
        sb.append(", userId=").append(userId);
        sb.append(", shopId=").append(shopId);
        sb.append(", loginName=").append(loginName);
        sb.append(", gatePassword=").append(gatePassword);
        sb.append(", state=").append(state);
        sb.append(", shopGateName=").append(shopGateName);
        sb.append(", shopGateDesc=").append(shopGateDesc);
        sb.append(", province=").append(province);
        sb.append(", city=").append(city);
        sb.append(", county=").append(county);
        sb.append(", detailAddress=").append(detailAddress);
        sb.append(", longitude=").append(longitude);
        sb.append(", latitude=").append(latitude);
        sb.append(", gatePhone=").append(gatePhone);
        sb.append(", businessTime=").append(businessTime);
        sb.append(", trafficRoute=").append(trafficRoute);
        sb.append(", gatePic=").append(gatePic);
        sb.append(", limits=").append(limits);
        sb.append(", shopType=").append(shopType);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}